#include <iostream>
#include <algorithm>

using namespace std;

struct plane
{
    int T;
    int D;
    int L;
}p[20];

int m, n;
bool st[20];

bool dfs(int u, int last)
{
    if (u == n)
        return true;
    for (int i = 0; i < n; i++)
    {
        if (!st[i] && p[i].T + p[i].D >= last)
        {
            st[i] = true;
            if (dfs(u + 1, max(p[i].T, last) + p[i].L))  return true;
            st[i] = false;
        }
    }
    return false;
}

int main()
{
    cin >> m;
    while (m--)
    {
        cin >> n;
        for (int i = 0; i < n; i++)
        {
            int t, d, l;
            scanf("%d%d%d", &t, &d, &l);
            p[i] = { t, d, l };
        }

        memset(st, 0, sizeof st);
        if (dfs(0, 0)) puts("YES");
        else puts("NO");

    }
    return 0;
}